package com.yipei.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yipei.business.domain.MlInvestmentType;
import com.yipei.business.mapper.MlInvestmentTypeMapper;
import com.yipei.business.service.IMlInvestmentTypeService;
import com.yipei.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 基金分类Service业务层处理
 *
 * @author yipei
 * @date 2025-07-14
 */
@Service
public class MlInvestmentTypeServiceImpl  extends ServiceImpl<MlInvestmentTypeMapper, MlInvestmentType> implements IMlInvestmentTypeService
{
    @Autowired
    private MlInvestmentTypeMapper mlInvestmentTypeMapper;

    /**
     * 查询基金分类
     *
     * @param id 基金分类主键
     * @return 基金分类
     */
    @Override
    public MlInvestmentType selectMlInvestmentTypeById(Long id)
    {
        return mlInvestmentTypeMapper.selectMlInvestmentTypeById(id);
    }

    /**
     * 查询基金分类列表
     *
     * @param mlInvestmentType 基金分类
     * @return 基金分类
     */
    @Override
    public List<MlInvestmentType> selectMlInvestmentTypeList(MlInvestmentType mlInvestmentType)
    {
        return mlInvestmentTypeMapper.selectMlInvestmentTypeList(mlInvestmentType);
    }

    /**
     * 新增基金分类
     *
     * @param mlInvestmentType 基金分类
     * @return 结果
     */
    @Override
    public int insertMlInvestmentType(MlInvestmentType mlInvestmentType)
    {
        mlInvestmentType.setCreateTime(DateUtils.getNowDate());
        return mlInvestmentTypeMapper.insertMlInvestmentType(mlInvestmentType);
    }

    /**
     * 修改基金分类
     *
     * @param mlInvestmentType 基金分类
     * @return 结果
     */
    @Override
    public int updateMlInvestmentType(MlInvestmentType mlInvestmentType)
    {
        mlInvestmentType.setUpdateTime(DateUtils.getNowDate());
        return mlInvestmentTypeMapper.updateMlInvestmentType(mlInvestmentType);
    }

    /**
     * 批量删除基金分类
     *
     * @param ids 需要删除的基金分类主键
     * @return 结果
     */
    @Override
    public int deleteMlInvestmentTypeByIds(Long[] ids)
    {
        return mlInvestmentTypeMapper.deleteMlInvestmentTypeByIds(ids);
    }

    /**
     * 删除基金分类信息
     *
     * @param id 基金分类主键
     * @return 结果
     */
    @Override
    public int deleteMlInvestmentTypeById(Long id)
    {
        return mlInvestmentTypeMapper.deleteMlInvestmentTypeById(id);
    }
}
